package com.neusoft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neusoft.bean.User;
import com.neusoft.service.UserService;

@Controller
@RequestMapping(value="/user")
public class UserController {
	
	@Autowired
	public UserService userService;
	
	@RequestMapping(value="/addUser")
	public String addUser(User user){
		userService.addUser(user);
		return "go";
	}
	@RequestMapping("/delUser")
	public String delUser(User user){
		userService.delUser(user);
		return "go";
	}
	
	@RequestMapping("/showUser")
	public String showUser(ModelMap map){
		List<User> userList = userService.showUser();
		map.put("userList", userList);
		return "go";
	}
}
